package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateUserFeedbackPageDTO;
import com.itlong.cloud.POJO.VO.operate.OperateUserFeedbackVO;
import com.itlong.cloud.operate.service.IOperateUserFeedbackService;
import com.itlong.cloud.user.operate.IOperateUserFeedbackServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.slf4j.Logger;import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <desc>
 *      运营—APP用户—用户反馈业务处理暴露接口实现类。
 * <desc/>
 *
 * @createDate 2017/9/25.
 */
@RestController
public class OperateUserFeedbackServiceResource implements IOperateUserFeedbackServiceClient {

    private static final Logger LOG = LoggerFactory.getLogger(OperateUserManageServiceResource.class);

    @Autowired
    IOperateUserFeedbackService iOperateUserFeedbackService;

    /**
     * <desc>
     *      反馈用户信息回复。
     * <desc/>
     *
     * @param id
     * @param  replyContent 回复内容
     * @return
     * @author shengen.T
     * @createDate 2017/9/25
     */
    @Override
    @RequestMapping(path = "/appUser/userFeedback/replyUserInfo")
    public Integer replyUserInfo(@RequestParam("id") String id,
                                 @RequestParam("replyContent") String replyContent,
                                 @RequestParam("clientShowResult") Integer clientShowResult){
        return  iOperateUserFeedbackService.replyInfo(id,replyContent,clientShowResult);
    }


    /**
     * <desc>
     *      获取反馈用户分页数据。
     * <desc/>
     *
     * @param  pageDTO 请求参数
     * @return 返回反馈用户列表
     * @author shengen.T
     * @createDate 2017/9/25
     */
    @Override
    @RequestMapping(path = "/appUser/userFeedback/getFeedbackUserPage")
    public Page<OperateUserFeedbackVO> getFeedbackUserPage(@RequestBody OperateUserFeedbackPageDTO pageDTO) throws Exception {
       return iOperateUserFeedbackService.getPage(pageDTO);
    }

    /**
     * <desc>
     *      处理app用户反馈主键为空的数据
     * </desc>
     *
     * @Author Zhu.yj
     * @createDate  2020/11/27
     */
    @Override
    @PostMapping("handlerFeedbackIdIsNull")
    public Integer handlerFeedbackIdIsNull() throws Exception {
        return iOperateUserFeedbackService.handlerFeedbackIdIsNull();
    }
}
